# 作业1
num_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
num_list1 = []
for i in num_list:
    if i % 2 == 0:
        num_list1.append(i)
print(num_list1)
# 作业2
cities = ["北京", "广州", "波士顿", "深圳", "湖南", "成都", "洛杉矶", "武汉", "浙江",
          "香港", "澳门"]
cities.insert(1, "上海")
cities.remove("波士顿")
cities.remove("洛杉矶")
cities[4] = ("长沙")
cities[7] = ("杭州")
cities.append("台北")
print(cities)
# 作业3
li = [1, "A", 2, "b", 3, "c", 4, "d"]
num_list2 = li[::2]
print(num_list2)
# 作业4
result = [i * i for i in range(1, 11)]
print(result)
# 作业5
t1 = (1, 2, 3, 2, 1)
print(t1.count(2))
# 作业6
t2 = ('apple', 'banana', 'cherry', 'date')
print(t2.index('cherry'))
